<template>
  <div id="App1">
    <h1>网站列表</h1>
    <div v-for="(site,url) in info" :key="url">
      <div class="haha">{{ url }}:{{ site }}</div>
    </div>
    <Haha />

  </div>
</template>

<script type = "text/javascript">

import Haha from './components/haha'

export default {
  name: 'App1',
  components: {
    Haha
  },
  data() {
    return {
      info: this.info
    }
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      this.$axios.get('http://127.0.0.1:5000/menu')
        .then(response => (this.info = response.data.menu)).catch(response => {
          console.log('error')
        })
    }
  }
}

</script>
